package entity;
// default package

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Consumer entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "consumer", catalog = "house")
public class Consumer implements java.io.Serializable {

	// Fields

	private Integer id;
	private Consumertypes consumertypes;
	private String CLoginName;
	private String CLoginPwd;
	private String CName;
	private String CSex;
	private String CEmail;
	private String CAffiliation;
	private String CFacsimile;
	private String CMobileTelephone;
	private String CQq;
	private Integer CPost;
	private String CAffiliationAddress;
	private String CCorporationName;
	private String CCorporationHomepage;
	private String CCorporationSynopsis;
	private Set<Usedhouse> usedhouses = new HashSet<Usedhouse>(0);

	// Constructors

	/** default constructor */
	public Consumer() {
	}

	/** minimal constructor */
	public Consumer(Consumertypes consumertypes, String CLoginName,
			String CLoginPwd, String CName, String CSex, String CAffiliation,
			String CMobileTelephone, Integer CPost, String CAffiliationAddress) {
		this.consumertypes = consumertypes;
		this.CLoginName = CLoginName;
		this.CLoginPwd = CLoginPwd;
		this.CName = CName;
		this.CSex = CSex;
		this.CAffiliation = CAffiliation;
		this.CMobileTelephone = CMobileTelephone;
		this.CPost = CPost;
		this.CAffiliationAddress = CAffiliationAddress;
	}

	/** full constructor */
	public Consumer(Consumertypes consumertypes, String CLoginName,
			String CLoginPwd, String CName, String CSex, String CEmail,
			String CAffiliation, String CFacsimile, String CMobileTelephone,
			String CQq, Integer CPost, String CAffiliationAddress,
			String CCorporationName, String CCorporationHomepage,
			String CCorporationSynopsis, Set<Usedhouse> usedhouses) {
		this.consumertypes = consumertypes;
		this.CLoginName = CLoginName;
		this.CLoginPwd = CLoginPwd;
		this.CName = CName;
		this.CSex = CSex;
		this.CEmail = CEmail;
		this.CAffiliation = CAffiliation;
		this.CFacsimile = CFacsimile;
		this.CMobileTelephone = CMobileTelephone;
		this.CQq = CQq;
		this.CPost = CPost;
		this.CAffiliationAddress = CAffiliationAddress;
		this.CCorporationName = CCorporationName;
		this.CCorporationHomepage = CCorporationHomepage;
		this.CCorporationSynopsis = CCorporationSynopsis;
		this.usedhouses = usedhouses;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "c_type", nullable = false)
	public Consumertypes getConsumertypes() {
		return this.consumertypes;
	}

	public void setConsumertypes(Consumertypes ertypeconsumertypess) {
		this.consumertypes = ertypeconsumertypess;
	}

	@Column(name = "c_loginName", nullable = false, length = 16)
	public String getCLoginName() {
		return this.CLoginName;
	}

	public void setCLoginName(String CLoginName) {
		this.CLoginName = CLoginName;
	}

	@Column(name = "c_loginPwd", nullable = false, length = 16)
	public String getCLoginPwd() {
		return this.CLoginPwd;
	}

	public void setCLoginPwd(String CLoginPwd) {
		this.CLoginPwd = CLoginPwd;
	}

	@Column(name = "c_name", nullable = false, length = 50)
	public String getCName() {
		return this.CName;
	}

	public void setCName(String CName) {
		this.CName = CName;
	}

	@Column(name = "c_sex", nullable = false, length = 2)
	public String getCSex() {
		return this.CSex;
	}

	public void setCSex(String CSex) {
		this.CSex = CSex;
	}

	@Column(name = "c_email", length = 50)
	public String getCEmail() {
		return this.CEmail;
	}

	public void setCEmail(String CEmail) {
		this.CEmail = CEmail;
	}

	@Column(name = "c_affiliation", nullable = false, length = 20)
	public String getCAffiliation() {
		return this.CAffiliation;
	}

	public void setCAffiliation(String CAffiliation) {
		this.CAffiliation = CAffiliation;
	}

	@Column(name = "c_facsimile", length = 20)
	public String getCFacsimile() {
		return this.CFacsimile;
	}

	public void setCFacsimile(String CFacsimile) {
		this.CFacsimile = CFacsimile;
	}

	@Column(name = "c_mobileTelephone", nullable = false, length = 20)
	public String getCMobileTelephone() {
		return this.CMobileTelephone;
	}

	public void setCMobileTelephone(String CMobileTelephone) {
		this.CMobileTelephone = CMobileTelephone;
	}

	@Column(name = "c_qq", length = 20)
	public String getCQq() {
		return this.CQq;
	}

	public void setCQq(String CQq) {
		this.CQq = CQq;
	}

	@Column(name = "c_post", nullable = false)
	public Integer getCPost() {
		return this.CPost;
	}

	public void setCPost(Integer CPost) {
		this.CPost = CPost;
	}

	@Column(name = "c_affiliationAddress", nullable = false, length = 50)
	public String getCAffiliationAddress() {
		return this.CAffiliationAddress;
	}

	public void setCAffiliationAddress(String CAffiliationAddress) {
		this.CAffiliationAddress = CAffiliationAddress;
	}

	@Column(name = "c_corporationName", length = 50)
	public String getCCorporationName() {
		return this.CCorporationName;
	}

	public void setCCorporationName(String CCorporationName) {
		this.CCorporationName = CCorporationName;
	}

	@Column(name = "c_corporationHomepage", length = 50)
	public String getCCorporationHomepage() {
		return this.CCorporationHomepage;
	}

	public void setCCorporationHomepage(String CCorporationHomepage) {
		this.CCorporationHomepage = CCorporationHomepage;
	}

	@Column(name = "c_corporationSynopsis", length = 500)
	public String getCCorporationSynopsis() {
		return this.CCorporationSynopsis;
	}

	public void setCCorporationSynopsis(String CCorporationSynopsis) {
		this.CCorporationSynopsis = CCorporationSynopsis;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "consumer")
	public Set<Usedhouse> getUsedhouses() {
		return this.usedhouses;
	}

	public void setUsedhouses(Set<Usedhouse> usedhouses) {
		this.usedhouses = usedhouses;
	}

}